using System;
using System.Collections.Generic;
using System.Text;
using Sedna.Core.Controller;
using Sedna.Core.Controller.Common;
using Iesi.Collections;

namespace Sedna.Core.Controls.Actions
{
    public class ValidateGridSelectionAction: AbstractValidationAction
    {
        private string selectedPath;
        
        public string SelectedPath
        {
            get{ return selectedPath;}
            set { selectedPath = value;}
        }
        
        protected override bool Validate(IExecutionContext executionContext)
        {
            ISet selected = (ISet) executionContext.GetPropertyValue(selectedPath);

            return (selected != null) && (selected.Count> 0);
        }
    }
}
